import request from '@/utils/request'


//用户详情
export function getuserinfo(data) {
  return new Promise((resolve, reject) => {
    request({
      url: '/api/user/info',
      method: 'get',
      data
    }).then(data => {
      resolve(data)
    }).catch((e) => {
      reject(e)
    })
  })
}
//账号资产
export function getUserassets(data,option) {
  return new Promise((resolve, reject) => {
    request({
      url: '/api/user/assets',
      method: 'get',
      data,	  ...option
    }).then(data => {
      resolve(data)
    }).catch((e) => {
      reject(e)
    })
  })
}
// 绑定手机号
export const bindMobile = (data, option) => {
  return new Promise((resolve, reject) => {
    request({
      url: '/api/user/bindMobile',
      method: 'post',
      data,
	  ...option
    }).then(data => {
      resolve(data)
    }).catch((e) => {
      reject(e)
    })
  })
}
//修改用户资料
export function editUser(data,option) {
  return new Promise((resolve, reject) => {
    request({
      url: '/api/user/personal',
      method: 'post',
      data,
	  ...option
    }).then(data => {
      resolve(data)
    }).catch((e) => {
      reject(e)
    })
  })
}